Skip to content

Comments

Validation with straight jQuery.#16

Open
gwadej wants to merge 4 commits intomasterfrom
wade_branch
Open

Validation with straight jQuery.#16
gwadej wants to merge 4 commits intomasterfrom
wade_branch

Conversation

@gwadej
Copy link

@gwadej gwadej commented Oct 7, 2015

I went a little overboard with the email validation. But, since I stole
the code from a Perl module I released some time ago, I figured it was
okay.

@chivygab @jaybobo @mikegee Please review.

I am currently stymied getting coffee-script installed. If I can get that done, I'll rewrite in that.

G. Wade Johnson added 2 commits October 7, 2015 16:14
I went a little overboard with the email validation. But, since I stole
the code from a Perl module I released some time ago, I figured it was
okay.
validator.js Outdated
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ha! Did you craft this yourself? I didn't see it in a quick scan of http://emailregex.com/

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jaybobo I stole it straight out of a Perl module I published a bit ago: https://metacpan.org/pod/Value::Object::ValidationUtils

And that's based on research I did for a previous job. So, yeah, I crafted it myself, after reading through all of the RFCs and ruining my brain.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ha, its no biggy. I was just wondering thats all. :)

Sent from my iPhone

On Oct 7, 2015, at 8:48 PM, "G. Wade Johnson" notifications@github.com
wrote:

In validator.js
#16 (comment)
:

@@ -1,7 +1,58 @@

//insert your code here
+function valid_email_local_part(lpart)
+{

  • if(lpart === undefined || lpart.length > 64 || lpart.length == 0)
  •    return false;
    
  • // Localpart is one or more atext pieces separated by .s
  • return lpart.match(/^[a-zA-Z0-9!#$%&'+-/=?^{|}~]+(?:.[a-zA-Z0-9!#\$\%&'_+-/=?^_{|}~]+)*$/);

@jaybobo https://github.com/jaybobo I stole it straight out of a Perl
module I published a bit ago:
https://metacpan.org/pod/Value::Object::ValidationUtils

And that's based on research I did for a previous job. So, yeah, I crafted
it myself, after reading through all of the RFCs and ruining my brain.


Reply to this email directly or view it on GitHub
https://github.com/paircolumbus/FormValidator/pull/16/files#r41466203.

I had an error in the way I used grep that caused validation problems. I
fixed that. Then, I added support for stopping submit on errors.
@gwadej
Copy link
Author

gwadej commented Oct 8, 2015

This is the last version doing the validation in straight jQuery and JavaScript.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants